using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Keyki.XNAGameEngine
{
	/// <summary>
	/// This is a game component that implements IUpdateable.
	/// </summary>
	public class Game2DObject : DrawableGameComponent
	{
		#region Variables

		private Vector2 m_position;
		private Vector2 m_size;
		private Texture2D m_texture;

		#endregion

		/// <summary>
		/// Creates new Game2DObject
		/// </summary>
		/// <param name="game"></param>
		/// <param name="textureName">align for texture</param>
		/// <param name="pos">Object position</param>
		/// <param name="size">Object size</param>
		public Game2DObject(Game game, string textureName, Vector2 pos, Vector2 size)
			: this(game, textureName, pos.X, pos.Y, (int) size.X, (int) size.Y)
		{
		}

		/// <summary>
		/// Creates new Game2DObject
		/// </summary>
		/// <param name="game"></param>
		/// <param name="textureName">align for texture</param>
		/// <param name="x">position by X coordinate</param>
		/// <param name="y">position by Y coordinate</param>
		/// <param name="width">Object width</param>
		/// <param name="heigth">Object heigth</param>
		public Game2DObject(Game game, string textureName, float x, float y,
		                    int width, int heigth)
			: base(game)
		{
			m_position = new Vector2(x, y);
			m_size = new Vector2(width, heigth);

			m_texture = game.Content.Load<Texture2D>(textureName);
		}

		/// <summary>
		/// Allows the game component to perform any initialization it needs to before starting
		/// to run.  This is where it can query for any required services and load content.
		/// </summary>
		public override void Initialize()
		{
			// TODO: Add your initialization code here

			base.Initialize();
		}

		/// <summary>
		/// Allows the game component to update itself.
		/// </summary>
		/// <param name="gameTime">Provides a snapshot of timing values.</param>
		public override void Update(GameTime gameTime)
		{
			// TODO: Add your update code here

			base.Update(gameTime);
		}

		public override void Draw(GameTime gameTime)
		{
			base.Draw(gameTime);
		}
	}
}